/****************************************************************
 * Copyright (c) 2006-2007 Besture All Rights Reserved.
 * 
 * File Name:		AppException.cs
 * 
 * Created:		2013/06/24
 * Original Author:	Ni Tao 
 * 
 * ------------------------------------------------------------
 * MODIFICATION HISTORY
 * ------------------------------------------------------------
 * When			Who		Why
 * ------------------------------------------------------------
 * 
 *
 ****************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using Besture.Common.Definition;

namespace Besture.Common.Exceptions
{
    /// <summary>
    /// Application exception Class
    /// </summary>
    public class AppException : System.Exception
    {
        private string csErrorMessage = "";
        private string csErrorID = "";

        /// <summary>
        /// application exception class
        /// </summary>
        public AppException()
        {
            csErrorID = Constants.MSG_ID_ZS0001;
            csErrorMessage = MessageManager.GetMessage(csErrorID);
        }

        /// <summary>
        /// application exception class
        /// </summary>
        /// <param name="ErrorID">error message id</param>
        public AppException(string ErrorID)
        {
            csErrorID= ErrorID ;
            csErrorMessage = MessageManager.GetMessage(csErrorID);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ErrorID">error message id</param>
        /// <param name="sParameter">replaced string collection</param>
        public AppException(string ErrorID,string[] sParameter)
        {
            csErrorMessage = MessageManager.GetMessage(csErrorID, sParameter);
        }
        /// <summary>
        /// Get the error message id.
        /// </summary>
        /// <returns>error message id</returns>
        public string GetErrorID()
        {
            return csErrorID;
        }
        /// <summary>
        /// Get the error message
        /// </summary>
        /// <returns>error message</returns>
        public string GetErrorMessage()
        {
            return csErrorMessage;
        }
    }
}
